#pragma once
namespace PhysLeo {

/**
 * Animable interface.
 * any object which want to be animated in PhysLeo should extends this interface.
 */
class Animable {
public:

    /**
     * empty constructor.
     * set max_dt_ to 0.001 as the default value
     */
	Animable() :max_dt_(0.001f) {}

    /**
     * delete default copy constructor
     */
    Animable(const Animable&) = delete;

    /**
     * delete default move constructor
     */
    Animable(Animable&&) = delete;

    /**
     * delete default copy assignment function
     */
    Animable& operator=(const Animable&) = delete;

    /**
     * delete default move assignment function
     */
    Animable& operator=(Animable&&) = delete;

    /**
     * default virtual destructor
     */
    virtual ~Animable() = default;

    /**
     * set max timestep for every animable entities
     * @param[in] max_dt  set the max timestep
     */
	void setMaxDt(const float max_dt) { max_dt_ = max_dt; }

    /**
     * init simulation resource, interface need to be implemented.
     */
	virtual void initSimulationResource() = 0;

    /**
     * animation steps forward dt second, interface need to be implemented.
     * @param[in] dt  time for one frame
     */
	virtual void run(float dt) = 0;

    /**
     * transform simulation data to render data, interface need to be implemented. 
     */
	virtual void transformDrawData() = 0;

    /**
     * update render data to GL buffer, interface need to be implemented.
     */
	virtual void updateDrawData() = 0;

protected:
    /**
     * max timestep for this animable entity
     */
	float max_dt_;
};

}